import java.util.Scanner;

//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class p5718 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int ans = 1000;
        for(int i=1; i<= n;i++){
            int x = scanner.nextInt();
            if(x<ans){
                ans = x;
            }
        }
        System.out.println(ans);
    }
}
